package cn.zkrt.iotms.feign;


import cn.zkrt.iotms.comm.Constant;
import cn.zkrt.iotms.feign.model.sinoeco.SinoecoAlert;
import cn.zkrt.iotms.feign.model.sinoeco.SinoecoAuthReq;
import cn.zkrt.iotms.feign.model.sinoeco.SinoecoToken;
import cn.zkrt.iotms.comm.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 中科生态告警平台接口
 *
 * @author litao
 */
@FeignClient(name = Constant.SINCEO_ALERT_CODE, url = "https://alert.sinoeco.net")
public interface WarningClient {

    /**
     * 获取token
     * @return
     */
    @PostMapping({"/api/auth/accessToken"})
    R<SinoecoToken> authAccessToken(@RequestBody SinoecoAuthReq req);


    /**
     * 发送告警信息
     * @param alert
     * @return
     */
    @PostMapping({"/api/alert/sending"})
    R<List<String>> alertSending(@RequestBody SinoecoAlert alert);
}
